<template>
  <div style="padding-top:50px">
     <Headers title="缺料详情"></Headers>
    <van-form @submit="onSubmit">
      <van-field class="noedit"
      readonly
        v-model="formData.field1"
        name="样衣号"
        label="样衣号"
        placeholder="样衣号"
      />
      <van-field
      readonly
      class="noedit"
        v-model="formData.field2"
        name="面料号"
        label="面料号"
        placeholder="面料号"
      />
       <van-field
      readonly
      class="noedit"
        v-model="formData.field3"
        name="本款熟练"
        label="本款熟练"
        placeholder="本款熟练"
      />
       <van-field
       :class="isEdit?'':'noedit'"
        v-model="formData.field4"
        name="调样数量"
        label="调样数量"
        placeholder="调样数量"
        type="number"
      />
       <van-tag v-show="isEdit" type="danger">附注：提交即生成调样申请单</van-tag>
      <div style="margin: 16px" v-show="isEdit">
        <van-button round block type="info" native-type="submit"
          >提交</van-button
        >
      </div>
    </van-form>
  </div>
</template>


<script>
import { Toast } from "vant";

export default {
  components: {},
  data() {
    return {
        isEdit:false,
        formData:{
            field1:"asasfasdfasdf",
             field2:"sdsdsds",
              field3:"1.6",
                field4:"1.6",
        }
    };
  },
  created() {
      let isEdit=this.$route.params.isEdit;
      if(isEdit){
          this.isEdit=true;
      }
  },
  mounted() {},
  methods: {
      onSubmit(){
          console.log(this.formData)
      }
  },
};
</script>
<style scoped lang="less">
.title{
     text-align: center;
  margin: 10px;
  font-size: 20px;
  line-height: 20px;
}
.noedit{
    background-color: #ccc;
}
</style>